package com.adou.d8.thread;

/**
 * 目标：常见方法
 */
public class ThreadTest5 {
    public static void main(String[] args) {
        Thread t1 = new MyThread();
        t1.setName("1号线程");
        t1.start();
        System.out.println(t1.getName());// Thread-0

        Thread t2 = new MyThread();
        t2.start();
        System.out.println(t2.getName());// Thread-1

        // 主线程
        Thread m = Thread.currentThread();
        System.out.println(m.getName());// main


        for (int i = 0; i < 5; i++) {
            System.out.println("主线程 Main 线程输出 " + i);
        }
    }
}
